<?php
// +----------------------------------------------------------------------
// | ebSIG
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.ebsig.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: liudaojian <liudaojian@ebsig.com>
// +----------------------------------------------------------------------

/**
 * 商管家路由
 * @author   liudaojian <liudaojian@ebsig.com>
 * @version 1.0
 */

namespace App\Http\Routes;

use Illuminate\Contracts\Routing\Registrar;

class StewardRoutes
{

    public function map(Registrar $router)
    {
        
        $prefix = '/lar/steward/';
        
        $router->group(['prefix' => $prefix], function($router) {

            $router->get('login', 'Steward\LoginController@index');
            $router->get('login/do', 'Steward\LoginController@login');
            $router->get('logout', 'Steward\LoginController@logout');

            $router->get('client/login', 'Steward\ClientController@login'); //客户端登录中转页

        });

		//与客户端交互接口组
		$router->group(['prefix' => $prefix, 'middleware'=>'steward.client'], function($router) {
			$router->post('client/order_fetch', 'Steward\ClientController@order_fetch'); //订单打印详情获取
            $router->get('client/notice', 'Steward\ClientController@notice'); //待提醒订单获取
		});

        $router->group(['middleware' => 'steward.service', 'prefix' => $prefix], function($router) {
            //首页
            $router->get('/', 'Steward\HomeController@main');
            $router->get('index', 'Steward\HomeController@index');

            //订单管理
            $router->get('order/{id}', 'Steward\OrderController@index'); //订单列表搜索页面
            $router->post('order/search/{id}', 'Steward\OrderController@search'); //订单列表数据查询
            $router->get('order/detail/{bill_no}/{bill_status}', 'Steward\OrderController@detail'); //订单详情查询
            $router->post('order/cancel', 'Steward\OrderController@cancel'); //订单取消
            $router->post('order/receive', 'Steward\OrderController@receive'); //订单接单
            $router->post('order/hang', 'Steward\OrderController@hang'); //订单挂起
            $router->post('order/cancel_hang', 'Steward\OrderController@cancelHang'); //订单取消挂起
            $router->post('order/packs', 'Steward\OrderController@packs'); //订单配货
            $router->post('order/packs_finish', 'Steward\OrderController@packsFinish'); //配货完成
            $router->post('order/delivery', 'Steward\OrderController@delivery'); //订单发货
            $router->post('order/finish', 'Steward\OrderController@finish'); //订单完成
            $router->post('order/agre_refund', 'Steward\OrderController@agreRefund'); //同意申请取消/退单
            $router->post('order/disagre_refund', 'Steward\OrderController@disagreRefund'); //不同意申请取消/退单
            $router->post('order/remind_reply', 'Steward\OrderController@remindReply'); //回复催单
            $router->post('order/print_log', 'Steward\OrderController@printLog'); //记录打印日志

            //商品管理
            $router->get('goods/list_{id}', 'Steward\GoodsController@index');    //商品列表
            $router->get('goods/batch_shelf', 'Steward\GoodsController@batchShelf');    //商品批量上下架
            $router->get('goods/search/{id}', 'Steward\GoodsController@search');  //商品列表信息查询
            $router->get('good/change_sale', 'Steward\GoodsController@changeSale');  //商品上下架
            $router->get('goods/spec_type/{mainPostID}', 'Steward\GoodsController@specType');  //商品规格管理列表
            $router->get('goods/search_spec/{mainPostID}', 'Steward\GoodsController@searchSpec');  //商品规格列表查询
            $router->get('goods/excel/export', 'Steward\GoodsController@export');  //导出上下架模板
            $router->get('good/change_sale_all', 'Steward\GoodsController@changeSaleAll');  //批量上下架文件上传


            //库存管理
            $router->get('stock', 'Steward\StockController@index');
            $router->get('stock/search', 'Steward\StockController@search');
            $router->get('stock/deletes', 'Steward\StockController@deletes');
            $router->get('stock/update', 'Steward\StockController@update');
            $router->get('stock/batch_stock', 'Steward\StockController@batchStock');  //库存上传
            $router->get('stock/export', 'Steward\StockController@export');  //导出库存上传模板
            $router->get('stock/batch_do', 'Steward\StockController@batchDo');  //批量库存添加


            //价格管理
            $router->get('price', 'Steward\PriceController@index');
            $router->get('price/search', 'Steward\PriceController@search');
            $router->get('price/update', 'Steward\PriceController@update');
            $router->get('price/batch_price', 'Steward\PriceController@batchPrice');  //价格上传
            $router->get('price/export', 'Steward\PriceController@export');         //导出价格上传模板
            $router->get('price/batch_do', 'Steward\PriceController@batchDo');      //批量操作价格

        });
    }
}